#include <stdio.h>
#include <string.h>
#define maxn 1010
int a[maxn];
int main()
{
#ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    memset(a, 0, sizeof(a));
    int n, k, first = 1;
    scanf("%d%d", &n, &k);
    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= k; j++)
        {
            if (i % j == 0)
            {
                a[i] = !a[i];
            }
        }
    for (int i = 1; i <= n; i++)
    {
        if (a[i])
        {
            if (first)
                first = 0;
            else
                printf(" ");
            printf("%d", i);
        }
    }
    printf("\n");
    return 0;
}